package com.csdj.DriverSchoolSystem.service;

import com.csdj.DriverSchoolSystem.entity.DriverSchool;
import com.csdj.DriverSchoolSystem.entity.DriverSchoolExample;
import com.csdj.DriverSchoolSystem.mapper.DriverSchoolMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DriverSchoolService implements IDriverSchoolService{

    @Autowired
    private DriverSchoolMapper driverSchoolMapper;

    @Override
    public List<DriverSchool> selDs() {
        DriverSchoolExample driverSchoolExample = new DriverSchoolExample();
        driverSchoolExample.createCriteria();
        return driverSchoolMapper.selectByExample(driverSchoolExample);
    }

    @Override
    public DriverSchool selDsId(Integer id) {
        DriverSchoolExample driverSchoolExample = new DriverSchoolExample();
        driverSchoolExample.createCriteria().andIdEqualTo(id);
        return driverSchoolMapper.selectByExample(driverSchoolExample).get(0);
    }

    @Override
    public Integer updateDs(DriverSchool driverSchool) {
        return driverSchoolMapper.updateByPrimaryKey(driverSchool);
    }
}
